package com.easy;

/**
 * Created by Lxk on 2019/9/7.
 */
public class Solution171 {

    public int titleToNumber(String s) {
        int rowNum = 0;
        for (int i = 0; i < s.length(); i++) {
            rowNum *= 26;
            rowNum += (s.charAt(i) - 'A' + 1);
        }
        return rowNum;
    }

    public static void main(String[] args) {
        Solution171 solution171 = new Solution171();
        System.out.println(solution171.titleToNumber("ABC"));
    }

}
